package chapter404.demo2;

/**
 * super
 * final
 */
class Flower{
    public Flower(){
        System.out.println("欢迎使用花朵类");
    }
    public void Language(){
        System.out.println("美好");
    }
    final public void die(){//final最终 子类无法修改
        System.out.println("所有的花朵都会凋零");
    }
}
class Peony extends Flower{//继承
    public Peony(){
        super();
        System.out.println("欢迎创建牡丹对象");
    }
//     final public void die(){
//        System.out.println("永不凋零");
//    }
    public void Language() {//重写
        super.Language();//使用super调用父类方法
        System.out.println("富贵");
    }
}
public class Demo2 {
    public static void main(String[] args) {
        Peony peony = new Peony();
        peony.Language();
    }
}
